<template>
	<view class="search-bar">
		<u-input
			placeholder="前置图标"
			prefixIcon="search"
			clearable
			v-model="searchValue"
			prefixIconStyle="font-size: 22px;color: #909399"
		>
			<template slot="suffix">
				<u-button
					@click="emitVal()"
					icon="search"
					text="点击搜索"
					type="primary"
				/>
			</template>
		</u-input>
		<view class="search-history" />
	</view>
</template>
<script>
export default {
  data() {
    return {
      searchValue: ''
    }

  },
  methods: {
    // 返回值
    emitVal() {
      this.$emit('search', this.searchValue)
    }
  }
}
</script>
